import {del, get, post, put} from "@/api/base/http";
import {ApiUri} from "@/api/base/ApiPath";
// @ts-ignore
import Utils from "@/vue2-flow/src/utils/Common";

let ApiPath = new ApiUri();

export class NodeApi {

    static Gets = () => {
        return get(ApiPath.Node.HUB);
    }

    static Get = (Id: number) => {
        return get(ApiPath.Node.ROOT + Id);
    }

    static UpdateNodeParam = (UpdateNodeParam: object) => {
        return put(ApiPath.Node.UPDATE_NODE_PARAM, UpdateNodeParam);
    }

    static DeleteNode = (CurrentFlowId: Number, processors: string, links: string) => {
        return del(ApiPath.Node.ROOT, {FlowId: CurrentFlowId, NodeIds: processors, LinkIds: links})
    }

    static Save = (Node: any) => {
        return post(ApiPath.Node.ROOT, Node)
    }

    static Connection = (Conn: object) => {
        return post(ApiPath.Node.CONNECTION, Conn)
    }

    static SaveMesNodeRequestParams = (Config: object) => {
        return post(ApiPath.Node.SAVE_NODE_MES_CONFIG, Config)
    }
}
